﻿using System;
using System.Threading.Tasks;
using Ymatou.User.Dto.Auth;
using YmtAuth.Domain.Model.YmatouUser;
using YmtAuth.Dto;

namespace YmtAuth.AppService
{
    public interface ITokenAppService
    {
        [Obsolete("use SaveUserAuthTokenToMainTokenTables")]
        UserToken SaveUserAuthToken_Obsolete(int userId, long tokenTimeOut, string tokenSource);      
        ResponseData<string> CreateUserToken(UserTokenDto dto);
        /// <summary>
        /// 创建用户token
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [Obsolete("use CreateUserTokenToMainTokenTables")]
        ResponseData<string> CreateUserToken_Obsolete(UserTokenDto dto);

        ResponseData<TokenResponseDto> GetUserByToken(SignAuthRequestDto dto);
                
        /// <summary>
        /// 根据token获取用户ID
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResponseData<TokenResponseDto> GetUserByToken_Obsolete(SignAuthRequestDto dto);
        /// <summary>
        /// 签名校验
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResponseData<SignAuthResponseDto2> CheckSign(SignAuthRequestDto dto);
        [Obsolete("use CheckSign")]
        ResponseData<SignAuthResponseDto2> CheckSign_Obsolete(SignAuthRequestDto dto);
        /// <summary>
        /// 移除token
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        ResponseData<string> RemoveToken(UserRemoveTokenRequestDto dto);
    }
}
